package com.czmini.cztest.common;

/**
 * @ProjectName: cztest
 * @Package: com.czmini.cztest.common
 * @ClassName: ServiceExpection
 * @Author: 还是那个橙子
 * @Description: 自定义异常 继承runtimeexcepttion
 * @Date: 2022/3/6 14:54
 * @Version: 1.0
 */

public class ServiceException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private String message;


    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public ServiceException(final String message, Throwable th){
        super(message,th);
        this.message = message;
    }

    public ServiceException(final String message){
        this.message = message;
    }

    public static void throwEx(String message){
        throw new ServiceException(message);
    }

}

